/*  File Name	: MsgBlockPool.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-7-2
 *  Description:
 */

#ifndef MSGBLOCKPOOL_H_
#define MSGBLOCKPOOL_H_
#include "ObjectPool.h"

class MsgBlockPool
{
public:
	typedef ObjectPool<MessageBlock> BlockPool;

public:
	MsgBlockPool(int block_size,std::string name="");

	virtual ~MsgBlockPool();

	void set_pool_name(std::string name);

	int block_size(void);

	int push( MessageBlock *mb);

	int pop(MessageBlock *&mb);

private:

	BlockPool *block_pool_;

	int pool_size_;

	int block_size_;
};

#endif /* MSGBLOCKPOOL_H_ */
